﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true"
    CodeBehind="Product.aspx.cs" Inherits="MyWeb.Admins.Product" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="PageName">
        Sản Phẩm</div>
    <asp:Panel ID="pnView" runat="server">
           <div style="margin-bottom: 5px">
            <asp:DropDownList ID="drlChuyenmuc" runat="server" AutoPostBack="true"  
                onselectedindexchanged="drlChuyenmuc_SelectedIndexChanged">
            </asp:DropDownList>
        </div>
        <div class="Control">
            <ul>
                <li>
                    <asp:LinkButton CssClass="vadd" ID="lbtAddT" runat="server" OnClick="AddButton_Click">Thêm mới</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vdelete" ID="lbtDeleteT" runat="server" OnClick="DeleteButton_Click">Xóa</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vrefresh" ID="lbtRefreshT" runat="server" OnClick="RefreshButton_Click">Làm mới</asp:LinkButton></li>
                <li><a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở
                    lại</a> </li>
            </ul>
        </div>
        <asp:DataGrid ID="grdProduct" runat="server" Width="100%" CssClass="TableView" AutoGenerateColumns="False"
            AllowPaging="True" PageSize="20" PagerStyle-Mode="NumericPages" PagerStyle-HorizontalAlign="Center"
            OnItemDataBound="grdProduct_ItemDataBound" OnItemCommand="grdProduct_ItemCommand"
            OnPageIndexChanged="grdProduct_PageIndexChanged">
            <HeaderStyle CssClass="trHeader"></HeaderStyle>
            <ItemStyle CssClass="trOdd"></ItemStyle>
            <AlternatingItemStyle CssClass="trEven"></AlternatingItemStyle>
            <Columns>
                <asp:TemplateColumn ItemStyle-CssClass="tdCenter">
                    <HeaderTemplate>
                        <asp:CheckBox ID="chkSelectAll" runat="server" AutoPostBack="False"></asp:CheckBox>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                    <ItemStyle CssClass="tdCenter"></ItemStyle>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="Id" HeaderText="Id" Visible="False" />
                <asp:BoundColumn DataField="Active" HeaderText="Active" Visible="False" />
                <asp:BoundColumn DataField="Name" HeaderText="Tên" ItemStyle-CssClass="MultiLine"
                    Visible="true" />
                <asp:TemplateColumn ItemStyle-CssClass="Image">
                    <HeaderTemplate>
                        Hình ảnh</HeaderTemplate>
                    <ItemTemplate>
                        <script type="text/javascript">                            playfile('<%#DataBinder.Eval(Container.DataItem, "Image").ToString() %>', "95", "80", "false", "", "", "")</script>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="PriceOld" HeaderText="Giá Cũ" ItemStyle-CssClass="MoneyUSD"
                    Visible="true" />
                <asp:BoundColumn DataField="PriceNew" HeaderText="Giá Mới" ItemStyle-CssClass="MoneyUSD"
                    Visible="true" />
                <asp:BoundColumn DataField="Number" HeaderText="Số lượng" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:TemplateColumn ItemStyle-CssClass="DateTime">
                    <HeaderTemplate>
                        Ngày đăng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# MyWeb.Common.DateTimeClass.ConvertDateTime(DataBinder.Eval(Container.DataItem, "Date").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="SaleOff" HeaderText="Khuyến mãi" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:BoundColumn DataField="Views" HeaderText="Lượt xem" ItemStyle-CssClass="Text"
                    Visible="true" />
                <asp:TemplateColumn ItemStyle-CssClass="Active">
                    <HeaderTemplate>
                        Kích hoạt</HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblStatus" runat="server" Text='<%# MyWeb.Common.PageHelper.ShowActiveStatus(DataBinder.Eval(Container.DataItem, "Active").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Function">
                    <HeaderTemplate>
                        Chức năng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:ImageButton ID="cmdEdit" runat="server" AlternateText="Sửa" CommandName="Edit"
                            CssClass="Edit" ToolTip="Sửa" ImageUrl="/App_Themes/Admin/images/edit.png" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id")%>' /><asp:ImageButton
                                ID="cmdDelete" runat="server" AlternateText="Xóa" CommandName="Delete" CssClass="Delete"
                                ToolTip="Xóa" ImageUrl="/App_Themes/Admin/images/delete.png" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id")%>'
                                OnClientClick="javascript:return confirm('Bạn có muốn xóa?');" /><asp:ImageButton
                                    ID="cmdActive" runat="server" AlternateText='<%#MyWeb.Common.PageHelper.ShowActiveToolTip(DataBinder.Eval(Container.DataItem, "Active").ToString())%>'
                                    CommandName="Active" CssClass="Active" ToolTip='<%# MyWeb.Common.PageHelper.ShowActiveToolTip(DataBinder.Eval(Container.DataItem, "Active").ToString())%>'
                                    ImageUrl='<%#MyWeb.Common.PageHelper.ShowActiveImage(DataBinder.Eval(Container.DataItem, "Active").ToString())%>'
                                    CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id")%>' /></ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <PagerStyle HorizontalAlign="Center" CssClass="Paging" Position="Bottom" NextPageText="Previous"
                PrevPageText="Next" Mode="NumericPages"></PagerStyle>
        </asp:DataGrid>
        <div class="Control">
            <ul>
                <li>
                    <asp:LinkButton CssClass="vadd" ID="lbtAddB" runat="server" OnClick="AddButton_Click">Thêm mới</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vdelete" ID="lbtDeleteB" runat="server" OnClick="DeleteButton_Click">Xóa</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vrefresh" ID="lbtRefreshB" runat="server" OnClick="RefreshButton_Click">Làm mới</asp:LinkButton></li>
                <li><a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở
                    lại</a> </li>
            </ul>
        </div>
    </asp:Panel>
    <asp:Panel ID="pnUpdate" runat="server" Visible="False">
        <table class="TableUpdate" border="1">
            <tr>
                <td class="Control" colspan="2">
                    <ul>
                        <li>
                            <asp:LinkButton CssClass="uupdate" ID="lbtUpdateT" runat="server" OnClick="Update_Click">Ghi lại</asp:LinkButton></li>
                        <li>
                            <asp:LinkButton CssClass="uback" ID="lbtBackT" runat="server" OnClick="Back_Click"
                                CausesValidation="False">Trở về</asp:LinkButton></li>
                    </ul>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblGroupId" runat="server" Text="Nhóm sản phẩm:"></asp:Label>
                </th>
                <td>
                    <asp:DropDownList ID="ddlGroupProduct" runat="server">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rfvGroupProduct" runat="server" ControlToValidate="ddlGroupProduct"
                        Display="Dynamic" ErrorMessage="*" SetFocusOnError="True" />
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblName" runat="server" Text="Tên:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtName" runat="server" CssClass="text multiline" TextMode="MultiLine"></asp:TextBox><asp:RequiredFieldValidator
                        ID="rfvName" runat="server" ControlToValidate="txtName" Display="Dynamic" ErrorMessage="*"
                        SetFocusOnError="True"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblImage" runat="server" Text="Hình ảnh:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtImage" runat="server" CssClass="text image"></asp:TextBox>&nbsp;<input
                        id="btnImgImage" type="button" onclick="BrowseServer('<% =txtImage.ClientID %>','Images');"
                        value="Browse Server" />&nbsp;
                    <asp:Image ID="imgImage" runat="server" ImageAlign="Middle" Width="100px" />
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblDetail" runat="server" Text="Tóm tắt:"></asp:Label>
                </th>
                <td>
                    <FCKeditorV2:FCKeditor ID="fckDetail" runat="server" />
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblPriceOld" runat="server" Text="Giá Cũ:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtPriceOld" runat="server" CssClass="text number" />
                    
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblPriceNew" runat="server" Text="Giá Mới:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtPriceNew" runat="server" CssClass="text number" />
                    
                    
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblNumber" runat="server" Text="Số lượng:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtNumber" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblDate" runat="server" Text="Ngày đăng:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtDate" runat="server" CssClass="text datetime" />
                  
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblSaleOff" runat="server" Text="Khuyến mãi:"></asp:Label>
                </th>
                <td>
                    <asp:CheckBox ID="ChkSale" runat="server" />
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblDetailPro" runat="server" Text="Chi tiết:"></asp:Label>
                </th>
                <td>
                    <FCKeditorV2:FCKeditor ID="fckDetailPro" runat="server" />
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblViews" runat="server" Text="Lượt xem:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtViews" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
                <tr>
                <th>
                    <asp:Label ID="lblkeyword" runat="server" Text="Từ khóa:"></asp:Label>
                </th>
                <td>
                    <asp:TextBox ID="txtkeyword" runat="server" CssClass="text"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    <asp:Label ID="lblActive" runat="server" Text="Kích hoạt:"></asp:Label>
                </th>
                <td>
                    <asp:CheckBox ID="chkActive" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="Control" colspan="2">
                    <ul>
                        <li>
                            <asp:LinkButton CssClass="uupdate" ID="lbtUpdateB" runat="server" OnClick="Update_Click">Ghi lại</asp:LinkButton></li>
                        <li>
                            <asp:LinkButton CssClass="uback" ID="lbtBackB" runat="server" OnClick="Back_Click"
                                CausesValidation="False">Trở về</asp:LinkButton></li>
                    </ul>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
